<?php
require_once 'includes/db.class.php';
require_once 'includes/global.inc.php';
?>

<div class="search-background1">
    <label><img src="images/load.gif" alt="" /></label>
</div>
<div id="news" class="tabcon">


    <div id="resn2"></div>

    <?php
    $sql1="select * from articles WHERE category_id=2 LIMIT 3";
    $result1=$db->select($sql1);
    ?>

    <div id="pagesn1">
        <?php
        $query="select count(*) as tot from articles WHERE category_id=2";
        $countset=$db->runquery($query);
        $count=$db->get_row($countset);
        $tot=$count['tot'];
        $page=1;
        $ipp=3;//items per page
        $totalpages=ceil($tot/$ipp);
        echo"<ul class='pages'>";
        for($i=1;$i<=$totalpages; $i++)
        {
            echo"<li class='$i'>$i</li>";
        }
        echo"</ul>";
        ?>
    </div>
</div>


